import requests
import execjs
cookies = {
    'Hm_lvt_6146f11e5afab71309b3accbfc4a932e': '1735802007',
    'HMACCOUNT': '98C1325744E5CB7D',
    'JSESSIONID': 'D2174B5BBA22F18A6C7A31577237E01E',
    'Hm_lpvt_6146f11e5afab71309b3accbfc4a932e': '1735803174',
}

headers = {
    'Accept': 'application/json, text/plain, */*',
    'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
    'Connection': 'keep-alive',
    'Content-Type': 'application/octet-stream',
    # 'Cookie': 'Hm_lvt_6146f11e5afab71309b3accbfc4a932e=1735802007; HMACCOUNT=98C1325744E5CB7D; JSESSIONID=D2174B5BBA22F18A6C7A31577237E01E; Hm_lpvt_6146f11e5afab71309b3accbfc4a932e=1735803174',
    'Origin': 'https://www.spolicy.com',
    'Referer': 'https://www.spolicy.com/',
    'Sec-Fetch-Dest': 'empty',
    'Sec-Fetch-Mode': 'cors',
    'Sec-Fetch-Site': 'same-origin',
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0',
    'sec-ch-ua': '"Microsoft Edge";v="131", "Chromium";v="131", "Not_A Brand";v="24"',
    'sec-ch-ua-mobile': '?0',
    'sec-ch-ua-platform': '"Windows"',
}
with open('code1.js', 'r', encoding='utf8') as f:
    data = f.read()
data = bytes(execjs.compile(data).call('get_data')['data'])

response = requests.post('https://www.spolicy.com/info_api/policyType/showPolicyType', cookies=cookies, headers=headers, data=data)
print(response.text)
print(response.status_code)